tools/console: reset tty when xenconsole fails
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 24 Feb 2014 15:16:19 +0000 (15:16 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 19 Mar 2014 13:37:19 +0000 (13:37 +0000)
commit111931f36885874103d65685ab15ea3d25d93da7
treefd5676e0c23f8217a23a08a8084517433938e404
parentac1b0a4559a4cc7f3d89cb858e335bbbcc7f1e35
tools/console: reset tty when xenconsole fails

If xenconsole (the client program) fails, it calls err.  This would
previously neglect to reset the user's terminal to sanity.  Use atexit
to do so.

This routinely happens in Xen 4.4 RC5 with pygrub because libxl
writes the value "" to the tty xenstore key when using xenconsole.
After this patch this just results in a harmless error message.

Reported-by: M A Young <m.a.young@durham.ac.uk>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: M A Young <m.a.young@durham.ac.uk>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v2: Fix whitespace error (reintroduce hard tab)
    Fix commit message not to claim ignorance about root cause
tools/console/client/main.c